﻿@model IEnumerable<XHouse.Model.Modulo>

@{
    ViewBag.Title = "Lista de módulos";
}

<div class="row">
  <div class="col-xs-12 col-md-10 col-md-offset-1">

    <h3>Módulos</h3>

    <a class="btn btn-success white mt20 mb20" href="@Url.Action("Create", "Modulos")">
      <span class="glyphicon glyphicon-plus"></span> Nuevo Módulo
    </a>
      <div class="table-responsive">
    <table class="table table-striped">
      <thead>
          <tr>
              <th>Nombre</th>
              <th>Descripción</th>
              <th>Dirección</th>
              <th>Ubicación</th>
              <th>Tipo</th>
          </tr>
      </thead>
      <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>@Html.DisplayFor(modelItem => item.Nombre)</td>
                <td>@Html.DisplayFor(modelItem => item.Descripcion)</td>
                <td>@Html.DisplayFor(modelItem => item.Direccion)</td>
                <td>@Html.DisplayFor(modelItem => item.Ubicacion)</td>
                <td>@Html.DisplayFor(modelItem => item.Tipo)</td>

                <td>
                    <a class="btn btn-info btn-xs white" href="@Url.Action("Edit", "Modulos", new { id = item.Id })">
                        <span class="glyphicon glyphicon-pencil"></span> Editar
                    </a>
                    
                    <a class="btn btn-danger btn-xs white" onclick="return confirm('¿Esta seguro que desea eliminar el módulo?');" href="@Url.Action("Delete", "Modulos", new { id = item.Id })">
                        <span class="glyphicon glyphicon-remove"></span> Eliminar
                    </a>
                </td>
            </tr>
        }
      </tbody>
    </table>
          </div>
  </div>
</div>